import Vue from 'vue'
import VueRouter from 'vue-router'
import Movie from 'Pages/movie/Movie'
import Hot from 'Pages/movie/Hot'
import Theaters from 'Pages/Theaters'
import Mine from 'Pages/Mine'
import Error from 'Pages/Error'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/movie/n-hot',
}, {
    path: '/movie',
    component: Movie,
    children: [{
        path: 'n-hot',
        component: Hot
    }, {
        path: 'f-hot',
        component: Hot
    }]
}, {
    path: '/theaters',
    component: Theaters
}, {
    path: '/mine',
    component: Mine
}, {
    path: '/error',
    component: Error
}, {
    path: '**',
    redirect: '/error'
}]

const router = new VueRouter({
    routes,
    mode: 'history'
})

export default router